package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    /**
     * 根据用户 查询购物车里面的数据
     * @param shoppingCart
     * @return
     */
    List<ShoppingCart> list(ShoppingCart shoppingCart);

    /**
     * 添加购物车数据
     * @param shoppingCart
     */
    void add(ShoppingCart shoppingCart);

    /**
     * 更新购物车数量
     * @param cart1
     */
    @Update("update shopping_cart set number = #{number} where id = #{id}")
    void updateNumberById(ShoppingCart cart1);

    /**
     * 删除购物车数据
     * @param shoppingCart
     */
    void delete(ShoppingCart shoppingCart);
}
